// hex密文
function hexToHexArray(str) {
    return str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")
}
function hexToStr(str) {
    return String.fromCharCode.apply(null, new Uint8Array(hexToArrayBuffer(str)));
}
function arrayBufferToHex(ab) {
    return [...new Uint8Array(ab)].map((u)=>u.toString(16).padStart(2,'0')).join('');
}
function hexToArrayBuffer(str) {
    return new Uint8Array(str.length/2).map((b,i)=>hexToHexArray(str)[i]);
}
function base64ToHex(str) {
    for (var i = 0, bin = atob(str.replace(/[ \r\n]+$/, "")), hex = []; i < bin.length; ++i) {
        hex.push(bin.charCodeAt(i).toString(16).padStart(2,'0'));
    }
    return hex.join("");
}
function base64ToArrayBuffer(str){
    return hexToArrayBuffer(base64ToHex(str));
}